function eleDialog() {
    this.timer = null;
    this.alert = function (obj, callback) {
        let json = {
            content: '',
            title: '信息',
            btn: '确定'
        }
        $.extend(json, obj)
        let html = `<div class="el-message-box__wrapper msgbox-fade-enter-active msgbox-fade-enter-to" style="z-index:9999">
                        <div class="el-message-box">
                            <div class="el-message-box__header">
                                <div class="el-message-box__title">
                                    <span>${json.title}</span>
                                </div>
                                <button type="button" class="el-message-box__headerbtn">
                                    <i class="el-message-box__close el-icon-close"></i>
                                </button>
                            </div>
                            <div class="el-message-box__content">
                                <div class="el-message-box__container">
                                    <div class="el-message-box__message">
                                    ${json.content}
                                    </div>
                                </div>
                            </div>
                            <div class="el-message-box__btns">
                                <button type="button" class="el-button el-button--default el-button--small el-button--primary">
                                    <span>确定</span>
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="v-modal" style="z-index:9998"></div>`;
        $('body').append(html)
        $(".el-message-box__headerbtn").click(function () {
            $(".el-message-box__wrapper,.v-modal").fadeOut(100, function () {
                $(".el-message-box__wrapper,.v-modal").remove()
            })
        })
        $(".el-message-box__wrapper .el-message-box__btns .el-button").click(function () {
            $(".el-message-box__wrapper,.v-modal").fadeOut(100, function () {
                $(".el-message-box__wrapper,.v-modal").remove()
            })
            callback && callback();
        })
    },
        this.confirm = function (obj, callback) {
            let json = {
                content: '',
                title: '提示',
                btn: ['确定', '取消']
            }
            $.extend(json, obj)
            let html = `<div class="el-message-box__wrapper msgbox-fade-enter-active msgbox-fade-enter-to" style="z-index: 9999;">
                        <div class="el-message-box">
                            <div class="el-message-box__header">
                                <div class="el-message-box__title">
                                    <span>${json.title}</span>
                                </div>
                                <button type="button" class="el-message-box__headerbtn">
                                    <i class="el-message-box__close el-icon-close"></i>
                                </button>
                            </div>
                            <div class="el-message-box__content">
                                <div class="el-message-box__container">
                                    <div class="el-message-box__status el-icon-warning"></div>
                                    <div class="el-message-box__message">
                                        ${json.content}
                                    </div>
                                </div>
                            </div>
                            <div class="el-message-box__btns">
                                <button type="button" class="el-button el-button--default el-button--small">
                                    <span>${json.btn[1]}</span>
                                </button>
                                <button type="button" class="el-button el-button--default el-button--small el-button--primary ">
                                    <span>${json.btn[0]}</span>
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="v-modal" style="z-index:9998"></div>`;
            $('body').append(html);
            $(".el-message-box__wrapper .el-message-box__btns .el-button:eq(0),.el-message-box__headerbtn").click(function () {
                $(".el-message-box__wrapper,.v-modal").fadeOut(100, function () {
                    $(".el-message-box__wrapper,.v-modal").remove()
                })
            })
            $(".el-message-box__wrapper .el-message-box__btns .el-button:eq(1)").click(function () {
                $(".el-message-box__wrapper,.v-modal").fadeOut(100, function () {
                    $(".el-message-box__wrapper,.v-modal").remove();
                })
                callback();
            })
        },
        this.prompt = function (obj, callback) {
            let json = {
                content: '',
                title: '提示',
                btn: ['确定', '取消']
            }
            $.extend(json, obj)
            let html = `<div class="el-message-box__wrapper msgbox-fade-enter-active msgbox-fade-enter-to" style="z-index: 9999;">
                        <div class="el-message-box">
                            <div class="el-message-box__header">
                                <div class="el-message-box__title">
                                <span>${json.title}</span>
                                </div>
                                <button type="button" class="el-message-box__headerbtn">
                                    <i class="el-message-box__close el-icon-close"></i>
                                </button>
                            </div>
                            <div class="el-message-box__content">
                                <div class="el-message-box__container">
                                    <div class="el-message-box__message">
                                        ${json.content}
                                    </div>
                                </div>
                                <div class="el-message-box__input">
                                    <div class="el-input">
                                        <input type="text" autocomplete="off" placeholder="" class="el-input__inner">
                                    </div>
                                    <div class="el-message-box__errormsg" style="visibility: hidden;"></div>
                                </div>
                            </div>
                            <div class="el-message-box__btns">
                                <button type="button" class="el-button el-button--default el-button--small">
                                    <span>${json.btn[1]}</span>
                                </button>
                                <button type="button" class="el-button el-button--default el-button--small el-button--primary ">
                                    <span>${json.btn[0]}</span>
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="v-modal" style="z-index:9998"></div>`;
            $('body').append(html);
            $(".el-message-box__wrapper .el-message-box__btns .el-button:eq(0),.el-message-box__headerbtn").click(function () {
                $(".el-message-box__wrapper,.v-modal").fadeOut(100, function () {
                    $(".el-message-box__wrapper,.v-modal").remove()
                })
            })
            $(".el-message-box__wrapper .el-message-box__btns .el-button:eq(1)").click(function () {
                let inputText = $(".el-input__inner").val();
                console.log(inputText);
                $(".el-message-box__wrapper,.v-modal").fadeOut(100, function () {
                    $(".el-message-box__wrapper,.v-modal").remove();
                })
                callback(inputText);
            })
        },
        this.loading = function () {
            let html = `<div class="el-loading-mask">
                        <div class="el-loading-spinner">
                            <svg viewBox="25 25 50 50" class="circular">
                                <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
                            </svg>
                        </div>
                    </div>`;
            $('body').append(html);
        },
        this.msg = function (obj) {
            let json = {
                type: 'info',
                message: '',
                showClose: false,
                time: 3000
            }
            $.extend(json, obj);
            $('.el-message').remove();
            let html = `<div class="el-message el-message--${json.type} ${json.showClose ? 'is-closable' : ''}" style="top:-48px">
                        <i class= "el-message__icon el-icon-${json.type}"></i>
                        <p class="el-message__content">${json.message}</p>
                        ${json.showClose ? '<i class="el-message__closeBtn el-icon-close"></i>' : ''}
                    </div>`;
            $('body').append(html)
            $('.el-message').animate({ top: '20px' }, 100)
            if (this.timer != null) (clearTimeout(this.timer));
            this.timer = setTimeout(() => {
                $('.el-message').animate({ top: '-48px' }, 100, function () {
                    $('.el-message').remove();
                })
            }, json.time)
            if (json.showClose) {
                $('.el-icon-close').click(function () {
                    $('.el-message').remove()
                })
            }
        }
}